﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CrossGenLogic
{
    public class CharWithCount
    {
        private char _char;
        private int count;
        private bool isEmpty;

        public bool IsEmpty
        {
            get
            {
                return isEmpty;
            }
        }

        internal CharWithCount(char _char, int count, bool isempty)
        {
            this._char = _char;
            this.count = count;
            this.isEmpty = isempty;
        }

        internal CharWithCount(bool isempty)
        {
            this._char = ' ';
            this.count = 0;
            this.isEmpty = isempty;
        }

        public int Count
        {
            get { return count; }
        }
        public char Char
        {
            get
            {
                return _char;
            }
        }
        public void SetChar(char letter)
        {
            if (count == 0) _char = letter;
            count++;
        }

        public void DecreaseCount()
        {
            if (count > 0)
            {
                count--;
                if (count == 0) _char = ' ';
            }
        }
    }
}
